From: Doug Goldstein Date: Tue, 31 Oct 2017 15:20:11 +0000 (-0500) Subject: gdbsx: prefer privcmd character device X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1051 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=9f592d103014e9e63119d52dac19ba20c3574922;p=xen.git gdbsx: prefer privcmd character device Prefer using the character device over the proc file if the character device exists. CC: Elena Ufimtseva CC: Ian Jackson CC: Stefano Stabellini CC: Wei Liu Signed-off-by: Doug Goldstein Reviewed-by: Elena Ufimtseva Release-acked-by: Julien Grall --- diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c index 7ebf91435b..cc640d1d82 100644 --- a/tools/debugger/gdbsx/xg/xg_main.c +++ b/tools/debugger/gdbsx/xg/xg_main.c @@ -126,9 +126,11 @@ xg_init() int flags, saved_errno; XGTRC("E\n"); - if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) { - perror("Failed to open /proc/xen/privcmd\n"); - return -1; + if ((_dom0_fd=open("/dev/xen/privcmd", O_RDWR)) == -1) { + if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) { + perror("Failed to open /dev/xen/privcmd or /proc/xen/privcmd\n"); + return -1; + } } /* Although we return the file handle as the 'xc handle' the API * does not specify / guarentee that this integer is in fact